import {notImage,kong} from '@/static/images/index'
import { AtToast } from 'taro-ui-vue'
import Taro from '@tarojs/taro';
const baseMixin = {
    data(){
        return {
            title:'兔兔',
            kongPic:kong,//空资源图片
        }
    },
    methods:{
        success(){
            console.log('成功');
        },
        //设置默认图片
        defaultImg(){
            let img = event.srcElement;
            img.src = notImage
            img.onerror = null;
          },
          //跳转到指定url
          toPages(url){
              //导航页面  
            var tabList = [
                    '/pages/main/main',
                    '/pages/libo/libo',
                    '/pages/contacts/index',
                    '/pages/mine/mine',
            ];

            if (tabList.indexOf(url)!=-1) {
                Taro.switchTab({
                    url
                  })
                
              } else {
                Taro.redirectTo({
                    url
                  })
              }
          },
    }
}


export default baseMixin